{% extends 'layout.html' %}
{% block content %}

<div class="container">
  <div class="panel  panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">新增人员信息</h3>
    </div>

    <div class="panel-body">
        <!-- class="form-inline" ：水平排列-->
      <form METHOD="post">
        <!--            post 请求下要添加-->
        {% csrf_token %}

        <div class="form-group">
         <label>姓名:</label>
          <input type="text" class="form-control" name="user" placeholder="姓名" >
        </div>

        <div class="form-group">
          <label>年龄:</label>
          <input type="text" class="form-control" name="age" placeholder="年龄" />
        </div>

        <div class="form-group" >
          <label>性别:</label>
<!--          class="form-control" 样式控制-->
         <select class="form-control" name="gender">
           {% for item in gender_choice%}
           <option value="{{item.0}}">{{item.1}}</option>
           {% endfor %}
         </select>
        </div>

        <div class="form-group">
          <label>工资:</label>
          <input type="text" class="form-control" name="salary" placeholder="工资" />
        </div>

        <div class="form-group">
          <label>部门:</label>
          <select class="form-control" name="dep">
            {% for item in department%}
<!--            !!!!!这里直接item.id就出来了，但是在view中好像这种方法取不出来-->
            <option value="{{item.id}}">{{item.title}}</option>
            {% endfor %}
          </select>

        </div>

        <div class="form-group">
          <label>创建时间:</label>
          <input type="text" class="form-control" name="creat_time" placeholder="创建时间" />
        </div>

        <button type="submit" class="btn btn-primary">提交</button>
      </form>
    </div>
  </div>

  {% endblock %}